import {actionTypes} from "@/store/actionTypes";

const exampleInitialState = {}

export const reducers = (state = exampleInitialState, action) => {
  switch (action.type) {
    case actionTypes.SEARCH_DATA:
      return Object.assign({}, state, { searchData: action.searchData })
    case actionTypes.MBI_TYPE:
      return Object.assign({}, state, {mbiType: action.mbiType})
    case actionTypes.MBI_NAVIGATION:
      return Object.assign({}, state, {mbiNavigation: action.mbiNavigation})
    case actionTypes.BRAND_TYPE_DATE:
      return Object.assign({}, state, {brandTypeDate: action.brandTypeDate})
    case actionTypes.MONTH_RANKING: 
      return Object.assign({}, state, {monthRanking: action.monthRanking})
    case actionTypes.CHANGE_MBI_TYPE: 
      return Object.assign({}, state, {...action.payload})
    case actionTypes.CITY_LIST:
      return Object.assign({}, state, {cityList: action.cityList})
    case actionTypes.CITY_ID_CHANGE:
      return Object.assign({}, state, {cityId: action.cityId})
    case actionTypes.LATEST_MCI_DATE:
      return Object.assign({}, state, {latesMciDate: action.latesMciDate})
    case actionTypes.MCI_CITY_RANKING:
      return Object.assign({}, state, {monthRanking: action.monthRanking})
    case actionTypes.PAGE_TIME_CHANGE: 
      return Object.assign({}, state, {pageTime: action.pageTime})
    case actionTypes.USER_COMMENT: 
      return Object.assign({}, state, {indexUserComment: action.userComment})
    case actionTypes.HOTWORDS_TODAY:
      return Object.assign({}, state, {hotWords: action.hotWords})
    case actionTypes.FASTEST_BRAND:
      return Object.assign({}, state, {fastestBrand: action.fastestBrand})
    case actionTypes.MBI_INFO_BYID:
      return Object.assign({}, state, {mbiInfoById: action.mbiInfoById})
    case actionTypes.MBI_INDEX:
      return Object.assign({}, state, {mbiIndex: action.mbiIndex})
    case actionTypes.HISTORY_RANKING:
      return Object.assign({}, state, { historyRanking: action.historyRanking})
    case actionTypes.MBI_PK_DATA:
      return Object.assign({}, state, {mbiPkData: action.mbiPkData})
    case actionTypes.MEADIA_DATA_SCALE:
      return Object.assign({}, state, {meadiaDataScale: action.meadiaDataScale})
    case actionTypes.HOTWORDS_BRANDID:
      return Object.assign({}, state, {hotwordsBrandId: action.hotwordsBrandId})
    case actionTypes.MEADIA_UP_DATE:
      return Object.assign({}, state, {meadiaUpDate: action.meadiaUpDate})
    case actionTypes.COMMENT_TREND:
      return Object.assign({}, state, {commentTrend: action.commentTrend})
    case actionTypes.COMMON_CHANGE_WAY:
      return Object.assign({}, state, {...action.payload})
    case actionTypes.SEARCH_NAME:
      return Object.assign({}, state, {searchData: action.searchData})
    case actionTypes.THUMBS_SHOW:
      return Object.assign({}, state, {...action.payload})
    case actionTypes.PK_COMMENT:
      return Object.assign({}, state, {pkCommentData: action.pkCommentData})
    case actionTypes.MEADIA_DATA_TREND:
      return Object.assign({}, state, {meadiaDataTrend: action.meadiaDataTrend})
    case actionTypes.ATTENTION_LIST:
      return Object.assign({}, state, {attentionList: action.attentionList})
    case actionTypes.SCENIC_TREE:
      return Object.assign({}, state, {scenicTree: action.scenicTree})
    case actionTypes.SHARE_MONITOR_MCI:
      return Object.assign({}, state, {shareMonitorMci: action.shareMonitorMci})
    case actionTypes.SHARE_NEWEST_RANKING_MCI:
      return Object.assign({}, state, {shareRankingMci: action.shareRankingMci})
    case actionTypes.SHARE_MONITOR_MBI:
      return Object.assign({}, state, {shareMonitorMbi: action.shareMonitorMbi})
    case actionTypes.SHARE_RANKING_MBI:
      return Object.assign({}, state, {shareRankingMbi: action.shareRankingMbi})
    case actionTypes.SHARE_CUSTOMDETAIL:
      return Object.assign({}, state, {shareCustomDetail: action.shareCustomDetail})
    case actionTypes.DIVIDEBY_TYPE:
      return Object.assign({}, state, {divideByType: action.divideByType})
    case actionTypes.MCI_TYPE:
      return Object.assign({}, state, {mci_type: action.mci_type})
    case actionTypes.LIST_RANK_CUSTOM:
      return Object.assign({}, state, {listRankCustom: action.listRankCustom})
    case actionTypes.MVI_RANK:
      return Object.assign({}, state, {mviRank: action.mviRank})
    case actionTypes.MVI_DETAIL:
      return Object.assign({}, state, {mviDetail: action.mviDetail})
    case actionTypes.TOURISM_DETAIL:
      return Object.assign({}, state, {tourismDetail: action.tourismDetail})
    case actionTypes.TOURISM_MBI_INDEX:
      return Object.assign({}, state, {tourismMbiIndex: action.tourismMbiIndex})
    case actionTypes.HISTORY_BRANCHRANKING_TOURISM:
      return Object.assign({}, state, {historyBranchRankingTourism: action.historyBranchRankingTourism})
    
    default: return state
  }
}